import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-news',
  templateUrl: './news.component.html',
  styleUrls: ['./news.component.css']
})
export class NewsComponent implements OnInit {
  public newsTitle = "每日新闻"
  msg:string = '今日气温较高'		   //不加属性修饰符typescript会默认属性为public
    							                //定义数据是应指定数据类型（typescript规范


  public userInfor = {
    name:'张三',
    age:19
  }

  public titleInfor:string = "这是动态绑定的属性数据"

  public content:string = '<p>我是HTML代码数据</p>'



  public newsList:string[] = ['朝日新闻','午间新闻','晚间新闻'] 

  constructor() { 
    //  在构造函数中修改属性的值
    this.msg = '今天可能要下雨'
  }

  ngOnInit(): void {
  }
  say(){
    console.log('我是news组件')
  }
}
